]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Use one-shot idle/timeout functions
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 31 Oct 2025 17:13:54 +0000 (18:13 +0100)
committerMarge Bot <marge-bot@gnome.org>
Thu, 29 Jan 2026 15:16:05 +0000 (15:16 +0000)
gjs now provides overrides for GLib's one-shot idle/timeout
functions, so use them to save a bit of code and clearly
indicate that a callback is only invoked once.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3947>

subprojects/extensions-app/js/extensionManager.js

index 3150af36419dd12e7cc402d97fa2e7641ff62437..7914aad20309b74184c03feba4078e408156363e 100644 (file)
@@ -412,12 +412,11 @@ export const ExtensionManager = GObject.registerClass({
         if (this._updatesCheckId)
             return;
 
-        this._updatesCheckId = GLib.timeout_add_seconds(
+        this._updatesCheckId = GLib.timeout_add_seconds_once(
             GLib.PRIORITY_DEFAULT, 1, () => {
                 this.notify('n-updates');
 
                 delete this._updatesCheckId;
-                return GLib.SOURCE_REMOVE;
             });
     }
 });